<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<style type="text/css">
			.box{
				text-align: center;
			}
			.box .btn{
				margin: auto;
				width: 50px;
				height: 50px;
				line-height: 50px;
				background-color: #DDDDDD;
				border-radius: 100%;
				color: #FFFFFF;
				cursor: pointer;
			}
		</style>
	</head>
	<body>
		<div class="box">
			<div class="btn">
				开
			</div>
			<img class="img" src="img/pic_bulboff.gif"/>
		</div>
		<script type="text/javascript">
			(function(){
				var btn = document.querySelector(".btn");
				var img = document.querySelector(".img");
				btn.onclick = function() {
					console.log("this:", this);
					//console.log(this.innerHTML);
					if(this.innerHTML =="开") {
						img.src = "img/pic_bulbon.gif";
						this.innerHTML = "关";
						this.style.backgroundColor = "green";
					} else {
						img.src = "img/pic_bulboff.gif";
						this.innerHTML ="开";
						this.style.backgroundColor = "#ddd";
					}
				}
				}());
		</script>
	</body>
</html>
